package wqh.controller.view;



import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;
import wqh.global.GlobalSession;

import javax.servlet.http.HttpServletRequest;


@Controller
@CrossOrigin(origins = "*")
public class MainView {

    private static Logger logger = LoggerFactory.getLogger(MainView.class);

    @RequestMapping("")
    public ModelAndView dev(HttpServletRequest request)
    {
       // return new ModelAndView("dev_ftl");
        if(!GlobalSession.existSessionID(request.getSession().getId()))
        {
            return new ModelAndView("ftl_login");
        }
        return new ModelAndView("redirect:/view/index");
    }

    @RequestMapping("/tpson")
    public ModelAndView tpson(HttpServletRequest request)
    {
         return new ModelAndView("dev_ftl");
    }

}
